package cn.adair.oxframe.views;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import cn.adair.oxframe.R;
import cn.adair.oxframe.base.OxBaseFragment;

/**
 * 使用Fragment 懒加载时的错误页面
 */
public class ExampleFragment extends OxBaseFragment {

    String error;
    TextView message;

    public ExampleFragment(String error) {
        this.error = error;
    }

    @Override
    public int initLayout() {
        return R.layout.fragment_example;
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        View view = this.getView();
        if (view == null) return;
        message = view.findViewById(R.id.message);
        message.setText(error);
    }

}
